function add_titbit(movie_id)
{
	var titbit_url = $.trim($('#titbit_url').val());
	
	if(titbit_url == '')
	{
		alert('内容不能为空');
	}
	else
	{
		$.ajax({
			url: 'ajax.php?m=movie_titbit&a=do_add',
			type: 'post',
			dataType: 'text',
			data: {
				'mid' : movie_id,
				'titbit_url' : titbit_url
			},
			success: function(msg){
				alert(msg);
				window.location.reload();
			}
		});
	}
}

function add_refer(movie_id)
{
	var refer = $.trim($('#refer').val());
	
	if(refer == '')
	{
		alert('内容不能为空');
	}
	else
	{
		$.ajax({
			url: 'ajax.php?m=movie_refer&a=do_add',
			type: 'post',
			dataType: 'text',
			data: {
				'mid' : movie_id,
				'refer' : refer
			},
			success: function(msg){
				alert(msg);
				window.location.reload();
			}
		});
	}
}

function check_radio(obj, id)
{
	$('#'+id).val($(obj).val());
}

function upload_movie_image(movie_id)
{
	var cid = $("#cid").val();
	
	$('#upload_wating').show();
	$.ajax({
		url: 'ajax.php?m=image&a=ftp_upload',
		type: 'post',
		dataType: 'json',
		data: {
			'mid' : movie_id,
			'cid' : cid
		},
		error: function(){
			alert('上传失败');
			$('#upload_wating').hide();
		},
		success: function(json){
			$('#upload_wating').hide();
			if(json.status == 'true' && json.count != 0){
				alert("上传成功" + json.count + "个文件");
				window.location.reload();
			}
			else if(json.message != ''){
				alert(json.message);
			}
			else{
				alert('没有文件被上传');
			}
		}
	});
}

function click_check(obj, id)
{
	var checked = $(obj).attr('checked');
	if(checked == true){
		$('#'+id).removeAttr('checked');
	}
}